package com.dianxin.smartpark.service.common;

import com.chinatelecom.response.common.CommonResponseBody;
import com.dianxin.smartpark.dao.qo.common.SmartParkUserConfigQO;
import com.dianxin.smartpark.service.validation.Delete;
import com.dianxin.smartpark.service.validation.Save;
import com.dianxin.smartpark.service.validation.Update;
import com.dianxin.smartpark.service.vo.common.DevicePullDataVo;
import com.dianxin.smartpark.service.vo.common.SmartParkUserCardVO;
import com.dianxin.smartpark.service.vo.common.SmartParkUserConfigVO;
import com.dianxin.smartpark.service.vo.common.SmartParkUserTzVO;
import org.springframework.scheduling.annotation.Async;
import org.springframework.validation.annotation.Validated;

import java.util.List;

/**
 * 设备权限下发  获取权限等接口
 * 
 * @author chenjiasong
 * @date 2021-08-10
 */
public interface SmartParkDeviceAuthService
{
    /**
     * 下发用户设备权限
     *
     * @param userId 用户id
     */
    @Async
    void sendUserDeviceAuth(String userId, Integer opt, String cardNum) throws Exception;

    /**
     * 下发用户删除设备权限
     *
     * @param userId 用户id
     */
    @Async
    void sendUserDeviceDelAuth(String userId, Integer opt, String cardNum) throws Exception;

    /**
     * 批量下发用户卡、车牌权限
     *
     * @param userId 用户id
     */
    @Async
    void sendUserDeviceAuthBatch(String userId, Integer opt) throws Exception;

    /**
     * 批量下发删除用户卡、车牌权限
     *
     * @param userId 用户id
     */
    @Async
    public void sendUserDeviceDelAuthBatch(String userId, Integer opt ,String tenantId) throws Exception;

    /**
     * 根据设备code查询人员信息
     * @param deviceCode
     * @return
     * @throws Exception
     */
    List<String> getUserIdByDeviceCode(String deviceCode,String orgCode,String tenantId) throws Exception;

    /**
     * 查询人员是否有设备权限
     * @param deviceCode
     * @param userId
     * @return
     * @throws Exception
     */
    Boolean authUserIdandDeviceCode(String deviceCode, String userId, String orgCode, String tenantId) throws Exception;

    /**
     * mqtt 数据下发
     * @param opt  操作类型
     * @param device  设备code  多个逗号分隔
     * @param data  下发数据
     */
    @Async
    void sendMqtt(int opt,String device,Object data,String topic);
}
